Add unix: and npipe: transports to AZD external authentication#8371
Draft
Copilot wants to merge 13 commits into
Draft
Add unix: and npipe: transports to AZD external authentication#8371Copilot wants to merge 13 commits into
Copilot wants to merge 13 commits into
Conversation
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
bwateratmsft
May 26, 2026 18:14
View session
Contributor
|
Purpose for context: local HTTP(S) servers are discouraged in favor of pipes/UDS whenever possible. This seeks to add support for that but without breaking any existing behavior. |
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
…inked sockets Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
Copilot stopped reviewing on behalf of
bwateratmsft due to an error
June 4, 2026 18:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends
AZD_AUTH_ENDPOINTwith two new URL schemes so IDE hosts can hand tokens to AZD over OS-secured local IPC instead of standing up a loopback HTTPS server with a self-signed cert. The existinghttps:flow is unchanged.AZD_AUTH_KEYremains required for all schemes.Behavior
https://host:port— unchanged.AZD_AUTH_CERTandAZD_AUTH_KEYare both required; AZD rejectshttps:when no cert is provided.unix:/abs/path/to/socket(POSIX) — Unix domain socket. Cert MUST NOT be set;AZD_AUTH_KEYis required and forwarded. AZDstat()s the socket and its parent and refuses unless both are owned by the current euid and have group/other bits cleared. The socket path MUST NOT be a symlink — AZD rejects symlinked socket paths outright (no symlink support) so a link into a less-restricted directory cannot bypass the parent-directory permission check.npipe:ornpipe:////./pipe/(Windows) — named pipe viawinio.DialPipeContext. Cert MUST NOT be set;AZD_AUTH_KEYis required and forwarded. AZD queries the pipe's DACL after connect and refuses any allow ACE outside the current user / SYSTEM / Administrators.http:/ no-scheme — accepted for the local loopback test harness only.unix:/npipe:, the request URL is rewritten tohttp://azd-auth/token?...soRemoteCredentialis untouched; the transport pins the actual dial target.Changes
cli/azd/cmd/auth_transport.gocontainingbuildExternalAuthConfiguration;container.go'sMustRegisterScopedfactory now defers to it.https:fails fast without a cert;unix:/npipe:fail fast without a key.auth_transport_unix.go(//go:build unix) for UDS + permission verification (including symlink rejection);auth_transport_windows.go(//go:build windows) for named pipes + structured DACL inspection;auth_transport_other.gostub for everything else. Each file exports the samenewSocketTransport/newPipeTransportsignature socontainer.gostays portable.github.com/Microsoft/go-winio v0.6.2as a direct requirement for pipe dialing (compiled in only on Windows).docs/external-authentication.md;AZD_AUTH_*rows incli/azd/docs/environment-variables.mdanddocs/reference/environment-variables.mdupdated to markAZD_AUTH_KEYrequired for all schemes and document the no-symlink rule;CHANGELOG.mdentry under Features Added.auth_transport_test.go(covers cert-required-for-https and key-required-for-unix/npipe); UDS permission and symlink rejection cases plus a full round trip throughhttptest.Serverbound to a UDS listener inauth_transport_unix_test.go; pipe path normalizer inauth_transport_windows_test.go.Notes for reviewers
golang.org/x/sys/windowslibrary (sd.DACL()+windows.GetAce+windows.EqualSid) rather than regex-parsing the SDDL string representation. Allowed principals are real*windows.SIDvalues: the current process token user (resolved viaOpenProcessToken+GetTokenUser) plusWinLocalSystemSidandWinBuiltinAdministratorsSid. Object-style allow ACEs (AD-flavored) are rejected defensively because their SID lives at a different offset thanACCESS_ALLOWED_ACE.SidStart.http://(no cert) is still accepted by the dispatcher to preserve the existinghttptest.NewServer-based functional tests undercli/azd/test/functional/auth_test.go.http://with a cert is rejected, as before.Out of scope (separate work)
vsrpc-mode equivalent forInitializeServerOptions.AuthenticationEndpointincli/azd/internal/vsrpc/models.go.